import pandas as pd

#读取数据
name=pd.read_csv("output_name.csv",encoding='UTF-8')
region=pd.read_csv("output_region.csv",encoding='UTF-8')
medium=pd.read_csv("output_medium.csv",encoding='UTF-8')
classification=pd.read_csv("output_classification.csv",encoding='UTF-8')
museum=pd.read_csv("output_museum.csv",encoding='UTF-8')
relation=pd.read_csv("output.csv",encoding='UTF-8')

print('create')
for i in name['name']:
    print("("+i.replace(', ','_').replace(' ','_')+":name{name:'"+ i+"'}),")
            
#创建region节点语句
for i in region['region']:
    print("("+i.replace(', ','_').replace(' ','_')+":region{region:'"+ i.replace(', ','_').replace(' ','_')+"'}),")
           
#创建medium节点语句
for i in medium['medium']:
    print("("+i.replace(', ','_').replace(' ','_')+":medium{medium:'"+ i.replace(', ','_').replace(' ','_')+"'}),")
    
#创建classification节点语句
for i in classification['classification']:
    print("("+i.replace(', ','_').replace(' ','_')+":classification{classification:'"+ i.replace(', ','_').replace(' ','_')+"'}),")

#创建museum节点语句
for i in museum['museum']:
    print("("+i+":museum{museum:'"+ i+"'}),")

b=0
for i in range(len(relation)):
    b=b+1
    if b<len(relation):
        print('('+relation['Subject'][i].replace(', ','_').replace(' ','_')+')-[:'+relation['Predicate'][i].replace(', ','_').replace(' ','_')+']->('+relation['Object'][i].replace(', ','_').replace(' ','_')+'),')
    else:
         
        print('('+relation['Subject'][i].replace(', ','_').replace(' ','_')+')-[:'+relation['Predicate'][i].replace(', ','_').replace(' ','_')+']->('+relation['Object'][i].replace(', ','_').replace(' ','_')+')')